<?php
session_start();
include("conn.inc");
//Smarty Settings :Start
require('./include/smarty/libs/Smarty.class.php');  // put full path to Smarty.class.php
$smarty = new Smarty();

$smarty->setTemplateDir('./templates');
$smarty->setCompileDir ('./include/smarty/omTemplates_c');
$smarty->setCacheDir   ('./include/smarty/omCache');
$smarty->setConfigDir  ('./include/smarty/omConfigs');
//Smarty Settings :End

/////////////// Date Wise Auto Interest Add Start ///////////////
date_default_timezone_set("Asia/Kolkata");
$today = date('d-m-Y');
$loanArray = array();
$i=0;

$selectLoan = "SELECT loan.accountId, loanId, account.accountName, loanAmount, fine,
                      loanDate, endDate, monthlyInterest, monthlyInterestRs
                 FROM loan
            LEFT JOIN account ON loan.accountId = account.accountId
                WHERE isSold = 'N'
                  AND isDeleted = 'N'
                  AND loanType = 'Monthly'";
$selectLoanRes = mysql_query($selectLoan);
while($loanRow = mysql_fetch_array($selectLoanRes))
{
  $loanArray[$i]['accountId']           = $loanRow['accountId'];
  $loanArray[$i]['loanId']              = $loanRow['loanId'];
  $loanArray[$i]['accountName']         = $loanRow['accountName'];
  $loanArray[$i]['loanAmount']          = $loanRow['loanAmount'];
  $loanArray[$i]['fine']                = $loanRow['fine'];
  $loanArray[$i]['loanDate']            = date('d-m-Y',strtotime($loanRow['loanDate']));
  $loanArray[$i]['endDate']             = date('d-m-Y',strtotime($loanRow['endDate']));
  $loanArray[$i]['monthlyInterest']     = $loanRow['monthlyInterest'];
  $loanArray[$i]['monthlyInterestRs']   = $loanRow['monthlyInterestRs'];
  $i++;
}
/////////////// Date Wise Auto Interest Add End ///////////////
?>